package com.baidu.mapapi;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Display;
import android.view.WindowManager;
import java.util.List;

public abstract class MapActivity extends Activity
{
  private MapView a = null;

  boolean a(MapView paramMapView)
  {
    if (this.a != null)
      throw new RuntimeException("A mapview has been created!!");
    this.a = paramMapView;
    Mj.d = paramMapView;
    return true;
  }

  public boolean initMapActivity(BMapManager paramBMapManager)
  {
    if (paramBMapManager == null);
    do
    {
      return false;
      if (this.a == null)
        throw new RuntimeException("A mapview has not been created!!");
    }
    while (Mj.InitMapControlCC(20, 40) != 1);
    this.a.a();
    return true;
  }

  protected boolean isLocationDisplayed()
  {
    if (this.a != null)
      return this.a.b.d();
    return false;
  }

  protected abstract boolean isRouteDisplayed();

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    Display localDisplay = getWindowManager().getDefaultDisplay();
    Mj.g = localDisplay.getWidth();
    Mj.h = localDisplay.getHeight();
  }

  protected void onDestroy()
  {
    if (this.a != null)
    {
      List localList = this.a.getOverlays();
      if (localList != null)
      {
        for (int i = -1 + localList.size(); i >= 0; i--)
        {
          Overlay localOverlay = (Overlay)localList.get(i);
          if ((localOverlay instanceof MyLocationOverlay))
          {
            MyLocationOverlay localMyLocationOverlay = (MyLocationOverlay)localOverlay;
            localMyLocationOverlay.disableMyLocation();
            localMyLocationOverlay.disableCompass();
          }
        }
        localList.clear();
      }
      this.a.b();
    }
    this.a = null;
    super.onDestroy();
  }

  public void onNewIntent(Intent paramIntent)
  {
    super.onNewIntent(paramIntent);
  }

  protected void onPause()
  {
    super.onPause();
  }

  protected void onResume()
  {
    if (Mj.d != this.a)
    {
      Mj.d = this.a;
      if (this.a != null)
        this.a.b.a(this.a.getLeft(), this.a.getTop(), this.a.getRight(), this.a.getBottom());
    }
    super.onResume();
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.baidu.mapapi.MapActivity
 * JD-Core Version:    0.6.2
 */